<#assign module="financial"/>

<@override name="header">
</@override>
<@override name="body">
<div class="row">
	<div class="col-xs-12">
	  	<div class="btn-group">
		  <a class="btn btn-default" href="${ctx}/financialrecord/list">财务明细（根据订单公司）</a>
		  <a class="btn btn-default" href="${ctx}/financialrecord/listByDriver">财务明细（根据服务人员公司）</a>
		  <a class="btn btn-default" href="${ctx}/financialrecord/driverlist">服务人员预存款</a>
		  <a class="btn btn-default active" href="${ctx}/financialrecord/memberlist">客户预存款</a>
		  <a class="btn btn-default" href="${ctx}/financialrecord/driverrechargelist">服务人员充值记录</a>
		  <a class="btn btn-default" href="${ctx}/financialrecord/memberrechargelist">客户账户明细</a>
		</div>
		<#if  param?? >
		<div class="btn-group" style="margin-left:10px;">
			<p class="form-control-static"><span style="color:#394249; font-weight:700;" class="btn btn-default btn-sm">当前搜索总预存款:${page.imprestMoney}</span></p>
		</div>
		</#if>
		<#if  param?? >
		<div class="btn-group" style="margin-left:10px;">
			<p class="form-control-static"><span style="color:#394249; font-weight:700;" class="btn btn-default btn-sm">当前搜索总余额:${page.nowMoney}</span></p>
		</div>
		</#if>
		<div class="btn-group" style="margin-left:20px;">
			<p class="form-control-static"><span style="font-weight:700;background-color:#394249;" class="btn  btn-success  btn-sm">总预存款：${page.allTotal}</span></p>
		</div>
		<div class="btn-group" style="margin-left:20px;">
			<p class="form-control-static"><span style="font-weight:700;background-color:#394249;" class="btn  btn-success  btn-sm">总余额：${page.total}</span></p>
		</div>
	</div>
	
</div>

<div class="row margin-top">
	<div class="col-xs-10">
		<form class="form-inline" role="form">
			<@shiro.isMainCompany>
				<select class="form-control" name="companyId" id="companyId">
					<option value="">全部</option>
		  			<#list companys as company>
		  				<option value="${company.id}" <#if companyId?? && companyId==company.id>selected="selected"</#if>>${company.abbreviation}</option>
		  			</#list>
	  			</select>
			</@shiro.isMainCompany>
		  	<div class="form-group">
		  		<input type="text" class="form-control" style="width:250px;" name="param" value="${param?if_exists}" placeholder="输入客户姓名、手机号">
		  	</div>
		  	<button type="submit" class="btn btn-primary"><i class="icon-search"></i>&nbsp;搜索</button>
		</form>
	</div>
	<div class="col-xs-2">
		<button class="pull-right btn btn-primary" onclick="window.location='${ctx}/financialrecord/exportMember?companyId=${companyId?if_exists}&param=${param?if_exists}';"><i class="glyphicon glyphicon-share-alt"></i>&nbsp;导出</button>
	</div>
</div>

<div class="row margin-top">
	<div class="col-xs-12">
	<div class="panel panel-primary">
	<div class="table-responsive">
		<table class="table table-hover table-striped">
			<thead>
			<tr style="font-size:14px;">
				<th>联系人</th>
				<th>手机号</th>
				<th>总预存款</th>
				<th>余额</th>
			</tr>
			</thead>
			<tbody>
				<#if (page.content)?? >
			  	<#list page.content as data>
					<tr>
						<td>
							<a target="_blank" href="${ctx}/member/money/${data.id}">
								${data.name?if_exists}
							</a>
						</td>
						<td>
							${data.phone?if_exists}
						</td>
						<td style="color:green;font-weight:700;">${data.advance?if_exists}</td>
						<td style="color:#ff950b;font-weight:700;">${data.drawMoney+data.nodrawMoney}</td>
					</tr>
				</#list>
				</#if>
			</tbody>
		</table>
		<#if page.totalElements??>
		<ul class="pagination pull-right pagination-sm">
			<li><a>共 ${page.totalElements} 条数据</a></li>
			<@pg.pager items=page.totalElements?number maxPageItems=20 export="currentPageNumber=pageNumber" url="${ctx}/financialrecord/memberlist">
				<@pg.param name="companyId" value="${companyId?if_exists}"/>
				<@pg.param name="param" value="${param?if_exists}"/>
				<@pg.index>
					<@pg.first>
						<li><a href="${pageUrl}">&laquo;</a></li>
					</@pg.first>
					<@pg.prev>
						<li><a href="${pageUrl}">&lsaquo;</a></li>
					</@pg.prev>
					<@pg.pages>
						<#if  currentPageNumber == pageNumber >
							<li class="active"><a href="#">${pageNumber}</a></li>
						<#else>
							<li><a href="${pageUrl}">${pageNumber}</a></li>
						</#if>
					</@pg.pages>
					<@pg.next>
						<li><a href="${pageUrl}">&rsaquo;</a></li>
					</@pg.next>
					<@pg.last>
						<li><a href="${pageUrl}">&raquo;</a></li>
					</@pg.last>
				</@pg.index>
			</@pg.pager>
		</ul>
		</#if>
	</div>
	</div>
	</div>
</div>

		
</@override>
<@override name="footer">
	<script type="text/javascript">
		window.daijia = {
			ctx:'${ctx}',
			userId:'<@shiro.principal property='id'/>'
		};
	</script>
	<script src="${ctx}/assets/js/pushmessage.js"></script>
</@override>
<@extends name="../layout.ftl"/>